NOTE: This Technical Q&A has been retired. Please see the Technical Q&As page for current documentation.

Technical Q&A HW18
Getting the Processor Type and Speed on a PCI Mac


Q: I am trying to write an application that, when run on a PCI Mac, queries the Name Registry database for the processor type and speed. I've been unable to find anything in Inside Macintosh: Designing PCI Cards and Drivers on this topic. Where can I find this information?

A: The Name Registry does not contain this information, but you can obtain it from the Gestalt Manager, just as you did on 68K Macs. This is discussed in Inside Macintosh: Operating System Utilities.

If you have a utility that already does this on a 68K Mac, it should also work on a PCI Mac. The code snippet below shows how to get the processor type:

//    This snippet calls the Gestalt Manager to read the machine type.
#include <stdio.h>#include <GestaltEqu.h>
// prototypes
void    main(void);
void    main(void)
{
    OSErr iErr = 0;
    OSType selector = 'mach';
    long response = 0;

    printf("DTS Absolutely Free (Gratis) Snippet\n\n");
    iErr = Gestalt(selector,&response);
    if(!iErr)
        printf("The informational selector 'mach' is %ld \n", response);
    else
        printf("Sorry, an error has occurred\n");
}

[Jul 15 1995]


Developer Documentation | Technical Notes | Development Kits | Sample Code